/**
 * Copyright (c) 2013-Now http://dreamcode123321.com All rights reserved.
 */
package com.jeesite.modules.ab.entity;

import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 公告Entity
 * @author dc
 * @version 2020-07-12
 */
@Table(name="ab_notiy", alias="a", columns={
		@Column(name="notiy_code", attrName="notiyCode", label="公告编号", isPK=true),
		@Column(name="title", attrName="title", label="标题", queryType=QueryType.LIKE),
		@Column(name="content", attrName="content", label="内容", isQuery=false),
		@Column(name="create_time", attrName="createTime", label="创建时间", isQuery=false),
		@Column(name="creater", attrName="creater", label="创建人", isQuery=false),
	}, orderBy="a.notiy_code DESC"
)
public class AbNotiy extends DataEntity<AbNotiy> {
	
	private static final long serialVersionUID = 1L;
	private String notiyCode;		// 公告编号
	private String title;		// 标题
	private String content;		// 内容
	private Date createTime;		// 创建时间
	private String creater;		// 创建人
	
	public AbNotiy() {
		this(null);
	}

	public AbNotiy(String id){
		super(id);
	}
	
	public String getNotiyCode() {
		return notiyCode;
	}

	public void setNotiyCode(String notiyCode) {
		this.notiyCode = notiyCode;
	}
	
	@NotBlank(message="标题不能为空")
	@Length(min=0, max=45, message="标题长度不能超过 45 个字符")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@NotBlank(message="内容不能为空")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="创建时间不能为空")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@NotBlank(message="创建人不能为空")
	@Length(min=0, max=45, message="创建人长度不能超过 45 个字符")
	public String getCreater() {
		return creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}
	
}